/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.trainee.aplikasipenjualan.entity;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author Jaka
 */
@Entity
@Table(name="t_penjualan_detail")
public class PenjualanDetail {
    
    @Id
    @Column(name="id", length=10)
    private String id;
    
    @Column(name="quantity", length=10)
    private Integer quantity;
    
//    @ManyToOne
//    @JoinColumn(name="hd_no_faktur",nullable=true)
//    private JualHeader hd;
    
    @ManyToOne
    @JoinColumn(name="barang_kodeBrg")
    private Barang barang;
    
    @Column(name="harga")
    private BigDecimal harga;

    
    //SETTER GETTER
    
    public BigDecimal getHarga() {
        return harga;
    }

    public void setHarga(BigDecimal harga) {
        this.harga = harga;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Barang getBarang() {
        return barang;
    }

    public void setBarang(Barang barang) {
        this.barang = barang;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }
    
    
}
